package com.demo.service.impl;

import com.demo.entity.Products;
import com.demo.mapper.ProductsMapper;
import com.demo.service.ProductsService;

import java.util.List;

public class ProductsServiceImpl implements ProductsService{
	//service������dao(mapper)
	private ProductsMapper productsMapper;
	public void setProductsMapper(ProductsMapper productsMapper) {
		this.productsMapper = productsMapper;
	}

	@Override
	public List<Products> queryProdectsInfo() {
		return productsMapper.queryProdectsInfo();
	}

	@Override
	public List<Products> queryPageProdectsInfo(int pnum) {
		return productsMapper.queryPageProdectsInfo(pnum);
	}

	@Override
	public void deleteProductInfo(String pid) {
		productsMapper.deleteProductInfo(pid);
	}

	@Override
	public void insertProductInfo(String pname, String pprice, int pnum, String pcategory, String pdescription) {
		productsMapper.insertProductInfo(pname, pprice, pnum, pcategory, pdescription);
	}

	@Override
	public void updateProductInfo(String pname, String pprice, int pnum, String pcategory, String pdescription,
			String pid) {
		productsMapper.updateProductInfo(pname, pprice, pnum, pcategory, pdescription, pid);
	}

	
}
